package com.smartstate.dataManagement.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smartstate.dataManagement.entity.CarbonConfig;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface CarbonConfigMapper extends BaseMapper<CarbonConfig> {


    @Select("select count(config_item) from  carbon_config where config_item =#{configItem};")
    int getIdByOne(String configItem);

    @Update("update carbon_config set config_item= #{configItem}, config_device = #{configDevice} where config_item= #{configItem}")
    void updateByItem(String configItem, String configDevice);

    @Select("select * from carbon_config where config_item =#{configItem}")
    CarbonConfig getByOne(String configItem);
}
